package com.etc.delivery.service.warehouse.impl;

import com.etc.delivery.dao.warehouse.IDriverDao;
import com.etc.delivery.entity.Driver;
import com.etc.delivery.service.warehouse.IDriverService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("driverServiceImpl2")
public class DriverServiceImpl implements IDriverService {

    @Resource
    private IDriverDao iDriverDao;

    @Override
    public List<Driver> queryAllDriverByWarehouse_id(Integer warehouse_id, String name) {
//        System.out.println("war"+warehouse_id);
        return iDriverDao.queryAllDriverByWarehouseById(warehouse_id, name);
    }

    @Override
    public boolean deleteDriver(int id) {
        int count = iDriverDao.deleteDriverById(id);
        return count > 0;
    }
}
